package class1;
//二维类坐标
public class Point2D {
    private int x;
    private int y;

    Point2D(int x, int y) {
        this(x);
        this.y = y;
    }

    Point2D() { y=99;
    }

    Point2D(int x) {
        this.x = x;
    }

    void setX() {
        this.x = x;
    }

    void setY() {
        this.y = y;
    }

    int getX() {
        return x;
    }

    int getY() {
        return y;
    }
}
//三维类坐标
class  Point3D extends  Point2D{
    private int z;
    Point3D(int x,int y,int z){super();this.z=z;}

    void setZ(){this.z=z;}
    int getZ(){return z;}


}

 class PointTester{
public static void main(String[]args){
    Point2D a=new Point2D(4,5);
    Point3D b=new Point3D(3,4,5);

    System.out.printf("a=(%d,%d)\n",a.getX(),a.getY());
    System.out.printf("b=(%d,%d,%d)\n",b.getX(),b.getY(),b.getZ());


}


}